import React from "react";
import styles from './uc-button.module.css'
import propsTypes from 'prop-types'


export default class UcButton extends React.Component {
    static defaultProps = {
        onClick: () => undefined,
        size: 'default',
        disabled: false,
        style: {},
        type: 'default'
    };
    static propsTypes = {
        onClick: propsTypes.func,
        size: propsTypes.string,
        disabled: propsTypes.bool,
        style: propsTypes.object,
        type: propsTypes.string
    };

    render() {
        let { style, type, disabled, size, onClick, children } = this.props;
        return (
            <button className={`${styles[`uc-button-${type}`]} ${styles[`uc-button-${type}--${size}`]}`} style={style} disabled={disabled} onClick={onClick}>{children ? children : '按钮'}</button>
        )
    }
}
